//package cn.iocoder.yudao.module.ai.controller.admin.datasetversion;
//
//import org.springframework.web.bind.annotation.*;
//import javax.annotation.Resource;
//import org.springframework.validation.annotation.Validated;
//import org.springframework.security.access.prepost.PreAuthorize;
//import io.swagger.v3.oas.annotations.tags.Tag;
//import io.swagger.v3.oas.annotations.Parameter;
//import io.swagger.v3.oas.annotations.Operation;
//
//import javax.validation.constraints.*;
//import javax.validation.*;
//import javax.servlet.http.*;
//import java.util.*;
//import java.io.IOException;
//
//import cn.iocoder.yudao.framework.common.pojo.PageParam;
//import cn.iocoder.yudao.framework.common.pojo.PageResult;
//import cn.iocoder.yudao.framework.common.pojo.CommonResult;
//import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
//import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
//
//import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
//
//import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
//import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
//
//import cn.iocoder.yudao.module.ai.controller.admin.datasetversion.vo.*;
//import cn.iocoder.yudao.module.ai.dal.dataobject.datasetversion.DatasetVersionDO;
//import cn.iocoder.yudao.module.ai.service.datasetversion.DatasetVersionService;
//
//@Tag(name = "管理后台 - 数据集发版列")
//@RestController
//@RequestMapping("/ai/dataset-version")
//@Validated
//public class DatasetVersionController {
//
//    @Resource
//    private DatasetVersionService datasetVersionService;
//
//    @PostMapping("/create")
//    @Operation(summary = "创建数据集发版列")
//    @PreAuthorize("@ss.hasPermission('ai:dataset-version:create')")
//    public CommonResult<Long> createDatasetVersion(@Valid @RequestBody DatasetVersionSaveReqVO createReqVO) {
//        return success(datasetVersionService.createDatasetVersion(createReqVO));
//    }
//
//    @PutMapping("/update")
//    @Operation(summary = "更新数据集发版列")
//    @PreAuthorize("@ss.hasPermission('ai:dataset-version:update')")
//    public CommonResult<Boolean> updateDatasetVersion(@Valid @RequestBody DatasetVersionSaveReqVO updateReqVO) {
//        datasetVersionService.updateDatasetVersion(updateReqVO);
//        return success(true);
//    }
//
//    @DeleteMapping("/delete")
//    @Operation(summary = "删除数据集发版列")
//    @Parameter(name = "id", description = "编号", required = true)
//    @PreAuthorize("@ss.hasPermission('ai:dataset-version:delete')")
//    public CommonResult<Boolean> deleteDatasetVersion(@RequestParam("id") Long id) {
//        datasetVersionService.deleteDatasetVersion(id);
//        return success(true);
//    }
//
//    @GetMapping("/get")
//    @Operation(summary = "获得数据集发版列")
//    @Parameter(name = "id", description = "编号", required = true, example = "1024")
//    @PreAuthorize("@ss.hasPermission('ai:dataset-version:query')")
//    public CommonResult<DatasetVersionRespVO> getDatasetVersion(@RequestParam("id") Long id) {
//        DatasetVersionDO datasetVersion = datasetVersionService.getDatasetVersion(id);
//        return success(BeanUtils.toBean(datasetVersion, DatasetVersionRespVO.class));
//    }
//
//    @GetMapping("/page")
//    @Operation(summary = "获得数据集发版列分页")
//    @PreAuthorize("@ss.hasPermission('ai:dataset-version:query')")
//    public CommonResult<PageResult<DatasetVersionRespVO>> getDatasetVersionPage(@Valid DatasetVersionPageReqVO pageReqVO) {
//        PageResult<DatasetVersionDO> pageResult = datasetVersionService.getDatasetVersionPage(pageReqVO);
//        return success(BeanUtils.toBean(pageResult, DatasetVersionRespVO.class));
//    }
//
//    @GetMapping("/export-excel")
//    @Operation(summary = "导出数据集发版列 Excel")
//    @PreAuthorize("@ss.hasPermission('ai:dataset-version:export')")
//    @ApiAccessLog(operateType = EXPORT)
//    public void exportDatasetVersionExcel(@Valid DatasetVersionPageReqVO pageReqVO,
//              HttpServletResponse response) throws IOException {
//        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
//        List<DatasetVersionDO> list = datasetVersionService.getDatasetVersionPage(pageReqVO).getList();
//        // 导出 Excel
//        ExcelUtils.write(response, "数据集发版列.xls", "数据", DatasetVersionRespVO.class,
//                        BeanUtils.toBean(list, DatasetVersionRespVO.class));
//    }
//
//}